<?php

class Application_Form_PrixProduit_RapportForm extends Zend_Form
{
    
  public function init()
  {
    $this->setName('rapport');
    //$validator = new Zend_Validate_Date();

    $date1 = new Zend_Form_Element_Text('date1');
    $date1->setLabel('Date de début : ')
      //->addValidator($validator)
      ->addValidator('NotEmpty')
      ->setValue(strftime("%d/%m/%Y", mktime(date('H'), date('i'), date('s'), date('m')-1, date('d'), date('Y'))))
      ->setDecorators(array('ViewHelper','FormErrors','Errors','Label'));

    $date2 = new Zend_Form_Element_Text('date2');
    $date2->setLabel('Date de fin : ')
      //->addValidator($validator)
      ->addValidator('NotEmpty')
      ->setValue(date('d/m/Y'))
      ->setDecorators(array('ViewHelper','FormErrors','Errors','Label'));

    $send = new Zend_Form_Element_Submit('send');
    $send->setAttrib('id','send_button')
      ->setLabel('Recherche')
      ->setAttrib('class','button')
      ->setDecorators(array('ViewHelper','FormErrors','Errors')); 

    $this->addElements(array($date1,$date2,$send));

  }

}